<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset='utf-8'>
</head>
    <style type="text/css">
        #list li{
            width: 400px;
            height: 40px;
            line-height: 40px;
            border-bottom: 1px solid #999;
        }
    </style>
<body>
        <ul id="list">
        <li>小静静, 你宣我吗?  宣1</li>
        <li>小静静, 你宣我吗?  宣2</li>
        <li>小静静, 你宣我吗?  宣3</li>
        <li>小静静, 你宣我吗?  宣4</li>
        <li>小静静, 你宣我吗?  宣5</li>
    </ul>

    <div id="btnlist">
        <button>获取第 1 句话</button>
        <button>获取第 2 句话</button>
        <button>获取第 3 句话</button>
        <button>获取第 4 句话</button>
        <button>获取第 5 句话</button>
    </div>

        
</body>



    <script>
       var btns = document.getElementById("btnlist").getElementsByTagName("button");
       var lis = document.getElementById("list").getElementsByTagName('li');

       
       for(var i = 0; i < btns.length;i++)
       {
            (function(i){
                 btns[i].onclick = function(){
                alert(lis[i].innerHTML);
            }
            })(i);
       }

    </script>
</html>